﻿using System;
using System.Diagnostics;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using HslCommunication.BasicFramework;
using HslCommunication.Core;
using HslCommunication.Core.Net;
using HslCommunication.Reflection;

namespace HslCommunication.Profinet.Melsec
{
	/// <summary>
	/// 三菱计算机链接协议的网口版本，适用FX3U系列，FX3G，FX3S等等系列，通常在PLC侧连接的是485的接线口<br />
	/// Network port version of Mitsubishi Computer Link Protocol, suitable for FX3U series, FX3G, FX3S, etc., usually the 485 connection port is connected on the PLC side
	/// </summary>
	/// <remarks>
	/// 支持的通讯的系列如下参考
	/// <list type="table">
	///     <listheader>
	///         <term>系列</term>
	///         <term>是否支持</term>
	///         <term>备注</term>
	///     </listheader>
	///     <item>
	///         <description>FX3UC系列</description>
	///         <description>支持</description>
	///         <description></description>
	///     </item>
	///     <item>
	///         <description>FX3U系列</description>
	///         <description>支持</description>
	///         <description></description>
	///     </item>
	///     <item>
	///         <description>FX3GC系列</description>
	///         <description>支持</description>
	///         <description></description>
	///     </item>
	///     <item>
	///         <description>FX3G系列</description>
	///         <description>支持</description>
	///         <description></description>
	///     </item>
	///     <item>
	///         <description>FX3S系列</description>
	///         <description>支持</description>
	///         <description></description>
	///     </item>
	///     <item>
	///         <description>FX2NC系列</description>
	///         <description>支持</description>
	///         <description></description>
	///     </item>
	///     <item>
	///         <description>FX2N系列</description>
	///         <description>部分支持(v1.06+)</description>
	///         <description>通过监控D8001来确认版本号</description>
	///     </item>
	///     <item>
	///         <description>FX1NC系列</description>
	///         <description>支持</description>
	///         <description></description>
	///     </item>
	///     <item>
	///         <description>FX1N系列</description>
	///         <description>支持</description>
	///         <description></description>
	///     </item>
	///     <item>
	///         <description>FX1S系列</description>
	///         <description>支持</description>
	///         <description></description>
	///     </item>
	///     <item>
	///         <description>FX0N系列</description>
	///         <description>部分支持(v1.20+)</description>
	///         <description></description>
	///     </item>
	///     <item>
	///         <description>FX0S系列</description>
	///         <description>不支持</description>
	///         <description></description>
	///     </item>
	///     <item>
	///         <description>FX0系列</description>
	///         <description>不支持</description>
	///         <description></description>
	///     </item>
	///     <item>
	///         <description>FX2C系列</description>
	///         <description>部分支持(v3.30+)</description>
	///         <description></description>
	///     </item>
	///     <item>
	///         <description>FX2(FX)系列</description>
	///         <description>部分支持(v3.30+)</description>
	///         <description></description>
	///     </item>
	///     <item>
	///         <description>FX1系列</description>
	///         <description>不支持</description>
	///         <description></description>
	///     </item>
	/// </list>
	/// 数据地址支持的格式如下：
	/// <list type="table">
	///   <listheader>
	///     <term>地址名称</term>
	///     <term>地址代号</term>
	///     <term>示例</term>
	///     <term>地址进制</term>
	///     <term>字操作</term>
	///     <term>位操作</term>
	///     <term>备注</term>
	///   </listheader>
	///   <item>
	///     <term>内部继电器</term>
	///     <term>M</term>
	///     <term>M100,M200</term>
	///     <term>10</term>
	///     <term>√</term>
	///     <term>√</term>
	///     <term></term>
	///   </item>
	///   <item>
	///     <term>输入继电器</term>
	///     <term>X</term>
	///     <term>X10,X20</term>
	///     <term>8</term>
	///     <term>√</term>
	///     <term>√</term>
	///     <term></term>
	///   </item>
	///   <item>
	///     <term>输出继电器</term>
	///     <term>Y</term>
	///     <term>Y10,Y20</term>
	///     <term>8</term>
	///     <term>√</term>
	///     <term>√</term>
	///     <term></term>
	///   </item>
	///   <item>
	///     <term>步进继电器</term>
	///     <term>S</term>
	///     <term>S100,S200</term>
	///     <term>10</term>
	///     <term>√</term>
	///     <term>√</term>
	///     <term></term>
	///   </item>
	///   <item>
	///     <term>定时器的触点</term>
	///     <term>TS</term>
	///     <term>TS100,TS200</term>
	///     <term>10</term>
	///     <term>√</term>
	///     <term>√</term>
	///     <term></term>
	///   </item>
	///   <item>
	///     <term>定时器的当前值</term>
	///     <term>TN</term>
	///     <term>TN100,TN200</term>
	///     <term>10</term>
	///     <term>√</term>
	///     <term>×</term>
	///     <term></term>
	///   </item>
	///   <item>
	///     <term>计数器的触点</term>
	///     <term>CS</term>
	///     <term>CS100,CS200</term>
	///     <term>10</term>
	///     <term>√</term>
	///     <term>√</term>
	///     <term></term>
	///   </item>
	///   <item>
	///     <term>计数器的当前</term>
	///     <term>CN</term>
	///     <term>CN100,CN200</term>
	///     <term>10</term>
	///     <term>√</term>
	///     <term>×</term>
	///     <term></term>
	///   </item>
	///   <item>
	///     <term>数据寄存器</term>
	///     <term>D</term>
	///     <term>D1000,D2000</term>
	///     <term>10</term>
	///     <term>√</term>
	///     <term>×</term>
	///     <term></term>
	///   </item>
	///   <item>
	///     <term>文件寄存器</term>
	///     <term>R</term>
	///     <term>R100,R200</term>
	///     <term>10</term>
	///     <term>√</term>
	///     <term>×</term>
	///     <term></term>
	///   </item>
	/// </list>
	/// </remarks>
	// Token: 0x0200006A RID: 106
	public class MelsecFxLinksOverTcp : NetworkDeviceBase
	{
		/// <summary>
		/// 实例化默认的对象<br />
		/// Instantiate the default object
		/// </summary>
		// Token: 0x06000889 RID: 2185 RVA: 0x0002E380 File Offset: 0x0002C580
		public MelsecFxLinksOverTcp()
		{
			base.WordLength = 1;
			base.ByteTransform = new RegularByteTransform();
			base.SleepTime = 20;
		}

		/// <summary>
		/// 指定ip地址和端口号来实例化默认的对象<br />
		/// Specify the IP address and port number to instantiate the default object
		/// </summary>
		/// <param name="ipAddress">Ip地址信息</param>
		/// <param name="port">端口号</param>
		// Token: 0x0600088A RID: 2186 RVA: 0x0002E3BC File Offset: 0x0002C5BC
		public MelsecFxLinksOverTcp(string ipAddress, int port)
		{
			base.WordLength = 1;
			this.IpAddress = ipAddress;
			this.Port = port;
			base.ByteTransform = new RegularByteTransform();
			base.SleepTime = 20;
		}

		/// <summary>
		/// PLC的当前的站号，需要根据实际的值来设定，默认是0<br />
		/// The current station number of the PLC needs to be set according to the actual value. The default is 0.
		/// </summary>
		// Token: 0x17000183 RID: 387
		// (get) Token: 0x0600088B RID: 2187 RVA: 0x0002E413 File Offset: 0x0002C613
		// (set) Token: 0x0600088C RID: 2188 RVA: 0x0002E41B File Offset: 0x0002C61B
		public byte Station
		{
			get
			{
				return this.station;
			}
			set
			{
				this.station = value;
			}
		}

		/// <summary>
		/// 报文等待时间，单位10ms，设置范围为0-15<br />
		/// Message waiting time, unit is 10ms, setting range is 0-15
		/// </summary>
		// Token: 0x17000184 RID: 388
		// (get) Token: 0x0600088D RID: 2189 RVA: 0x0002E424 File Offset: 0x0002C624
		// (set) Token: 0x0600088E RID: 2190 RVA: 0x0002E42C File Offset: 0x0002C62C
		public byte WaittingTime
		{
			get
			{
				return this.watiingTime;
			}
			set
			{
				bool flag = this.watiingTime > 15;
				if (flag)
				{
					this.watiingTime = 15;
				}
				else
				{
					this.watiingTime = value;
				}
			}
		}

		/// <summary>
		/// 是否启动和校验<br />
		/// Whether to start and sum verify
		/// </summary>
		// Token: 0x17000185 RID: 389
		// (get) Token: 0x0600088F RID: 2191 RVA: 0x0002E45D File Offset: 0x0002C65D
		// (set) Token: 0x06000890 RID: 2192 RVA: 0x0002E465 File Offset: 0x0002C665
		public bool SumCheck
		{
			get
			{
				return this.sumCheck;
			}
			set
			{
				this.sumCheck = value;
			}
		}

		/// <summary>
		/// 批量读取PLC的数据，以字为单位，支持读取X,Y,M,S,D,T,C，具体的地址范围需要根据PLC型号来确认，地址支持动态指定站号，例如：s=2;D100<br />
		/// Read PLC data in batches, in units of words, supports reading X, Y, M, S, D, T, C. 
		/// The specific address range needs to be confirmed according to the PLC model, 
		/// The address supports dynamically specifying the station number, for example: s=2;D100
		/// </summary>
		/// <param name="address">地址信息</param>
		/// <param name="length">数据长度</param>
		/// <returns>读取结果信息</returns>
		// Token: 0x06000891 RID: 2193 RVA: 0x0002E470 File Offset: 0x0002C670
		[HslMqttApi("ReadByteArray", "Read PLC data in batches, in units of words, supports reading X, Y, M, S, D, T, C.")]
		public override OperateResult<byte[]> Read(string address, ushort length)
		{
			byte b = (byte)HslHelper.ExtractParameter(ref address, "s", (int)this.station);
			OperateResult<byte[]> operateResult = MelsecFxLinksOverTcp.BuildReadCommand(b, address, length, false, this.sumCheck, this.watiingTime);
			bool flag = !operateResult.IsSuccess;
			OperateResult<byte[]> result;
			if (flag)
			{
				result = OperateResult.CreateFailedResult<byte[]>(operateResult);
			}
			else
			{
				OperateResult<byte[]> operateResult2 = base.ReadFromCoreServer(operateResult.Content);
				bool flag2 = !operateResult2.IsSuccess;
				if (flag2)
				{
					result = OperateResult.CreateFailedResult<byte[]>(operateResult2);
				}
				else
				{
					bool flag3 = operateResult2.Content[0] != 2;
					if (flag3)
					{
						result = new OperateResult<byte[]>((int)operateResult2.Content[0], "Read Faild:" + SoftBasic.ByteToHexString(operateResult2.Content, ' '));
					}
					else
					{
						byte[] array = new byte[(int)(length * 2)];
						for (int i = 0; i < array.Length / 2; i++)
						{
							ushort value = Convert.ToUInt16(Encoding.ASCII.GetString(operateResult2.Content, i * 4 + 5, 4), 16);
							BitConverter.GetBytes(value).CopyTo(array, i * 2);
						}
						result = OperateResult.CreateSuccessResult<byte[]>(array);
					}
				}
			}
			return result;
		}

		/// <summary>
		/// 批量写入PLC的数据，以字为单位，也就是说最少2个字节信息，支持X,Y,M,S,D,T,C，具体的地址范围需要根据PLC型号来确认，地址支持动态指定站号，例如：s=2;D100<br />
		/// The data written to the PLC in batches is in units of words, that is, at least 2 bytes of information. 
		/// It supports X, Y, M, S, D, T, and C. The specific address range needs to be confirmed according to the PLC model, 
		/// The address supports dynamically specifying the station number, for example: s=2;D100
		/// </summary>
		/// <param name="address">地址信息</param>
		/// <param name="value">数据值</param>
		/// <returns>是否写入成功</returns>
		// Token: 0x06000892 RID: 2194 RVA: 0x0002E58C File Offset: 0x0002C78C
		[HslMqttApi("WriteByteArray", "The data written to the PLC in batches is in units of words, that is, at least 2 bytes of information. It supports X, Y, M, S, D, T, and C. ")]
		public override OperateResult Write(string address, byte[] value)
		{
			byte b = (byte)HslHelper.ExtractParameter(ref address, "s", (int)this.station);
			OperateResult<byte[]> operateResult = MelsecFxLinksOverTcp.BuildWriteByteCommand(b, address, value, this.sumCheck, this.watiingTime);
			bool flag = !operateResult.IsSuccess;
			OperateResult result;
			if (flag)
			{
				result = operateResult;
			}
			else
			{
				OperateResult<byte[]> operateResult2 = base.ReadFromCoreServer(operateResult.Content);
				bool flag2 = !operateResult2.IsSuccess;
				if (flag2)
				{
					result = operateResult2;
				}
				else
				{
					bool flag3 = operateResult2.Content[0] != 6;
					if (flag3)
					{
						result = new OperateResult((int)operateResult2.Content[0], "Write Faild:" + SoftBasic.ByteToHexString(operateResult2.Content, ' '));
					}
					else
					{
						result = OperateResult.CreateSuccessResult();
					}
				}
			}
			return result;
		}

		/// <inheritdoc cref="M:HslCommunication.Profinet.Melsec.MelsecFxLinksOverTcp.Read(System.String,System.UInt16)" />
		// Token: 0x06000893 RID: 2195 RVA: 0x0002E640 File Offset: 0x0002C840
		[DebuggerStepThrough]
		public override Task<OperateResult<byte[]>> ReadAsync(string address, ushort length)
		{
			MelsecFxLinksOverTcp.<ReadAsync>d__13 <ReadAsync>d__ = new MelsecFxLinksOverTcp.<ReadAsync>d__13();
			<ReadAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult<byte[]>>.Create();
			<ReadAsync>d__.<>4__this = this;
			<ReadAsync>d__.address = address;
			<ReadAsync>d__.length = length;
			<ReadAsync>d__.<>1__state = -1;
			<ReadAsync>d__.<>t__builder.Start<MelsecFxLinksOverTcp.<ReadAsync>d__13>(ref <ReadAsync>d__);
			return <ReadAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.Profinet.Melsec.MelsecFxLinksOverTcp.Write(System.String,System.Byte[])" />
		// Token: 0x06000894 RID: 2196 RVA: 0x0002E694 File Offset: 0x0002C894
		[DebuggerStepThrough]
		public override Task<OperateResult> WriteAsync(string address, byte[] value)
		{
			MelsecFxLinksOverTcp.<WriteAsync>d__14 <WriteAsync>d__ = new MelsecFxLinksOverTcp.<WriteAsync>d__14();
			<WriteAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult>.Create();
			<WriteAsync>d__.<>4__this = this;
			<WriteAsync>d__.address = address;
			<WriteAsync>d__.value = value;
			<WriteAsync>d__.<>1__state = -1;
			<WriteAsync>d__.<>t__builder.Start<MelsecFxLinksOverTcp.<WriteAsync>d__14>(ref <WriteAsync>d__);
			return <WriteAsync>d__.<>t__builder.Task;
		}

		/// <summary>
		/// 批量读取bool类型数据，支持的类型为X,Y,S,T,C，具体的地址范围取决于PLC的类型，地址支持动态指定站号，例如：s=2;D100<br />
		/// Read bool data in batches. The supported types are X, Y, S, T, C. The specific address range depends on the type of PLC, 
		/// The address supports dynamically specifying the station number, for example: s=2;D100
		/// </summary>
		/// <param name="address">地址信息，比如X10,Y17，注意X，Y的地址是8进制的</param>
		/// <param name="length">读取的长度</param>
		/// <returns>读取结果信息</returns>
		// Token: 0x06000895 RID: 2197 RVA: 0x0002E6E8 File Offset: 0x0002C8E8
		[HslMqttApi("ReadBoolArray", "Read bool data in batches. The supported types are X, Y, S, T, C.")]
		public override OperateResult<bool[]> ReadBool(string address, ushort length)
		{
			byte b = (byte)HslHelper.ExtractParameter(ref address, "s", (int)this.station);
			OperateResult<byte[]> operateResult = MelsecFxLinksOverTcp.BuildReadCommand(b, address, length, true, this.sumCheck, this.watiingTime);
			bool flag = !operateResult.IsSuccess;
			OperateResult<bool[]> result;
			if (flag)
			{
				result = OperateResult.CreateFailedResult<bool[]>(operateResult);
			}
			else
			{
				OperateResult<byte[]> operateResult2 = base.ReadFromCoreServer(operateResult.Content);
				bool flag2 = !operateResult2.IsSuccess;
				if (flag2)
				{
					result = OperateResult.CreateFailedResult<bool[]>(operateResult2);
				}
				else
				{
					bool flag3 = operateResult2.Content[0] != 2;
					if (flag3)
					{
						result = new OperateResult<bool[]>((int)operateResult2.Content[0], "Read Faild:" + SoftBasic.ByteToHexString(operateResult2.Content, ' '));
					}
					else
					{
						byte[] array = new byte[(int)length];
						Array.Copy(operateResult2.Content, 5, array, 0, (int)length);
						result = OperateResult.CreateSuccessResult<bool[]>(Enumerable.ToArray<bool>(Enumerable.Select<byte, bool>(array, (byte m) => m == 49)));
					}
				}
			}
			return result;
		}

		/// <summary>
		/// 批量写入bool类型的数组，支持的类型为X,Y,S,T,C，具体的地址范围取决于PLC的类型，地址支持动态指定站号，例如：s=2;D100<br />
		/// Write arrays of type bool in batches. The supported types are X, Y, S, T, C. The specific address range depends on the type of PLC, 
		/// The address supports dynamically specifying the station number, for example: s=2;D100
		/// </summary>
		/// <param name="address">PLC的地址信息</param>
		/// <param name="value">数据信息</param>
		/// <returns>是否写入成功</returns>
		// Token: 0x06000896 RID: 2198 RVA: 0x0002E7F0 File Offset: 0x0002C9F0
		[HslMqttApi("WriteBoolArray", "Write arrays of type bool in batches. The supported types are X, Y, S, T, C.")]
		public override OperateResult Write(string address, bool[] value)
		{
			byte b = (byte)HslHelper.ExtractParameter(ref address, "s", (int)this.station);
			OperateResult<byte[]> operateResult = MelsecFxLinksOverTcp.BuildWriteBoolCommand(b, address, value, this.sumCheck, this.watiingTime);
			bool flag = !operateResult.IsSuccess;
			OperateResult result;
			if (flag)
			{
				result = operateResult;
			}
			else
			{
				OperateResult<byte[]> operateResult2 = base.ReadFromCoreServer(operateResult.Content);
				bool flag2 = !operateResult2.IsSuccess;
				if (flag2)
				{
					result = operateResult2;
				}
				else
				{
					bool flag3 = operateResult2.Content[0] != 6;
					if (flag3)
					{
						result = new OperateResult((int)operateResult2.Content[0], "Write Faild:" + SoftBasic.ByteToHexString(operateResult2.Content, ' '));
					}
					else
					{
						result = OperateResult.CreateSuccessResult();
					}
				}
			}
			return result;
		}

		/// <inheritdoc cref="M:HslCommunication.Profinet.Melsec.MelsecFxLinksOverTcp.ReadBool(System.String,System.UInt16)" />
		// Token: 0x06000897 RID: 2199 RVA: 0x0002E8A4 File Offset: 0x0002CAA4
		[DebuggerStepThrough]
		public override Task<OperateResult<bool[]>> ReadBoolAsync(string address, ushort length)
		{
			MelsecFxLinksOverTcp.<ReadBoolAsync>d__17 <ReadBoolAsync>d__ = new MelsecFxLinksOverTcp.<ReadBoolAsync>d__17();
			<ReadBoolAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult<bool[]>>.Create();
			<ReadBoolAsync>d__.<>4__this = this;
			<ReadBoolAsync>d__.address = address;
			<ReadBoolAsync>d__.length = length;
			<ReadBoolAsync>d__.<>1__state = -1;
			<ReadBoolAsync>d__.<>t__builder.Start<MelsecFxLinksOverTcp.<ReadBoolAsync>d__17>(ref <ReadBoolAsync>d__);
			return <ReadBoolAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.Profinet.Melsec.MelsecFxLinksOverTcp.Write(System.String,System.Boolean[])" />
		// Token: 0x06000898 RID: 2200 RVA: 0x0002E8F8 File Offset: 0x0002CAF8
		[DebuggerStepThrough]
		public override Task<OperateResult> WriteAsync(string address, bool[] value)
		{
			MelsecFxLinksOverTcp.<WriteAsync>d__18 <WriteAsync>d__ = new MelsecFxLinksOverTcp.<WriteAsync>d__18();
			<WriteAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult>.Create();
			<WriteAsync>d__.<>4__this = this;
			<WriteAsync>d__.address = address;
			<WriteAsync>d__.value = value;
			<WriteAsync>d__.<>1__state = -1;
			<WriteAsync>d__.<>t__builder.Start<MelsecFxLinksOverTcp.<WriteAsync>d__18>(ref <WriteAsync>d__);
			return <WriteAsync>d__.<>t__builder.Task;
		}

		/// <summary>
		/// <b>[商业授权]</b> 启动PLC的操作，可以携带额外的参数信息，指定站号。举例：s=2; 注意：分号是必须的。<br />
		/// <b>[Authorization]</b> Start the PLC operation, you can carry additional parameter information and specify the station number. Example: s=2; Note: The semicolon is required.
		/// </summary>
		/// <param name="parameter">允许携带的参数信息，例如s=2; 也可以为空</param>
		/// <returns>是否启动成功</returns>
		// Token: 0x06000899 RID: 2201 RVA: 0x0002E94C File Offset: 0x0002CB4C
		[HslMqttApi(Description = "Start the PLC operation, you can carry additional parameter information and specify the station number. Example: s=2; Note: The semicolon is required.")]
		public OperateResult StartPLC(string parameter = "")
		{
			byte b = (byte)HslHelper.ExtractParameter(ref parameter, "s", (int)this.station);
			OperateResult<byte[]> operateResult = MelsecFxLinksOverTcp.BuildStart(b, this.sumCheck, this.watiingTime);
			bool flag = !operateResult.IsSuccess;
			OperateResult result;
			if (flag)
			{
				result = operateResult;
			}
			else
			{
				OperateResult<byte[]> operateResult2 = base.ReadFromCoreServer(operateResult.Content);
				bool flag2 = !operateResult2.IsSuccess;
				if (flag2)
				{
					result = operateResult2;
				}
				else
				{
					bool flag3 = operateResult2.Content[0] != 6;
					if (flag3)
					{
						result = new OperateResult((int)operateResult2.Content[0], "Start Faild:" + SoftBasic.ByteToHexString(operateResult2.Content, ' '));
					}
					else
					{
						result = OperateResult.CreateSuccessResult();
					}
				}
			}
			return result;
		}

		/// <summary>
		/// <b>[商业授权]</b> 停止PLC的操作，可以携带额外的参数信息，指定站号。举例：s=2; 注意：分号是必须的。<br />
		/// <b>[Authorization]</b> Stop PLC operation, you can carry additional parameter information and specify the station number. Example: s=2; Note: The semicolon is required.
		/// </summary>
		/// <param name="parameter">允许携带的参数信息，例如s=2; 也可以为空</param>
		/// <returns>是否停止成功</returns>
		// Token: 0x0600089A RID: 2202 RVA: 0x0002E9FC File Offset: 0x0002CBFC
		[HslMqttApi(Description = "Stop PLC operation, you can carry additional parameter information and specify the station number. Example: s=2; Note: The semicolon is required.")]
		public OperateResult StopPLC(string parameter = "")
		{
			byte b = (byte)HslHelper.ExtractParameter(ref parameter, "s", (int)this.station);
			OperateResult<byte[]> operateResult = MelsecFxLinksOverTcp.BuildStop(b, this.sumCheck, this.watiingTime);
			bool flag = !operateResult.IsSuccess;
			OperateResult result;
			if (flag)
			{
				result = operateResult;
			}
			else
			{
				OperateResult<byte[]> operateResult2 = base.ReadFromCoreServer(operateResult.Content);
				bool flag2 = !operateResult2.IsSuccess;
				if (flag2)
				{
					result = operateResult2;
				}
				else
				{
					bool flag3 = operateResult2.Content[0] != 6;
					if (flag3)
					{
						result = new OperateResult((int)operateResult2.Content[0], "Stop Faild:" + SoftBasic.ByteToHexString(operateResult2.Content, ' '));
					}
					else
					{
						result = OperateResult.CreateSuccessResult();
					}
				}
			}
			return result;
		}

		/// <summary>
		/// <b>[商业授权]</b> 读取PLC的型号信息，可以携带额外的参数信息，指定站号。举例：s=2; 注意：分号是必须的。<br />
		/// <b>[Authorization]</b> Read the PLC model information, you can carry additional parameter information, and specify the station number. Example: s=2; Note: The semicolon is required.
		/// </summary>
		/// <param name="parameter">允许携带的参数信息，例如s=2; 也可以为空</param>
		/// <returns>带PLC型号的结果信息</returns>
		// Token: 0x0600089B RID: 2203 RVA: 0x0002EAAC File Offset: 0x0002CCAC
		[HslMqttApi(Description = "Read the PLC model information, you can carry additional parameter information, and specify the station number. Example: s=2; Note: The semicolon is required.")]
		public OperateResult<string> ReadPlcType(string parameter = "")
		{
			byte b = (byte)HslHelper.ExtractParameter(ref parameter, "s", (int)this.station);
			OperateResult<byte[]> operateResult = MelsecFxLinksOverTcp.BuildReadPlcType(b, this.sumCheck, this.watiingTime);
			bool flag = !operateResult.IsSuccess;
			OperateResult<string> result;
			if (flag)
			{
				result = OperateResult.CreateFailedResult<string>(operateResult);
			}
			else
			{
				OperateResult<byte[]> operateResult2 = base.ReadFromCoreServer(operateResult.Content);
				bool flag2 = !operateResult2.IsSuccess;
				if (flag2)
				{
					result = OperateResult.CreateFailedResult<string>(operateResult2);
				}
				else
				{
					bool flag3 = operateResult2.Content[0] != 6;
					if (flag3)
					{
						result = new OperateResult<string>((int)operateResult2.Content[0], "ReadPlcType Faild:" + SoftBasic.ByteToHexString(operateResult2.Content, ' '));
					}
					else
					{
						result = MelsecFxLinksOverTcp.GetPlcTypeFromCode(Encoding.ASCII.GetString(operateResult2.Content, 5, 2));
					}
				}
			}
			return result;
		}

		/// <inheritdoc cref="M:HslCommunication.Profinet.Melsec.MelsecFxLinksOverTcp.StartPLC(System.String)" />
		// Token: 0x0600089C RID: 2204 RVA: 0x0002EB78 File Offset: 0x0002CD78
		[DebuggerStepThrough]
		public Task<OperateResult> StartPLCAsync(string parameter = "")
		{
			MelsecFxLinksOverTcp.<StartPLCAsync>d__22 <StartPLCAsync>d__ = new MelsecFxLinksOverTcp.<StartPLCAsync>d__22();
			<StartPLCAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult>.Create();
			<StartPLCAsync>d__.<>4__this = this;
			<StartPLCAsync>d__.parameter = parameter;
			<StartPLCAsync>d__.<>1__state = -1;
			<StartPLCAsync>d__.<>t__builder.Start<MelsecFxLinksOverTcp.<StartPLCAsync>d__22>(ref <StartPLCAsync>d__);
			return <StartPLCAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.Profinet.Melsec.MelsecFxLinksOverTcp.StopPLC(System.String)" />
		// Token: 0x0600089D RID: 2205 RVA: 0x0002EBC4 File Offset: 0x0002CDC4
		[DebuggerStepThrough]
		public Task<OperateResult> StopPLCAsync(string parameter = "")
		{
			MelsecFxLinksOverTcp.<StopPLCAsync>d__23 <StopPLCAsync>d__ = new MelsecFxLinksOverTcp.<StopPLCAsync>d__23();
			<StopPLCAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult>.Create();
			<StopPLCAsync>d__.<>4__this = this;
			<StopPLCAsync>d__.parameter = parameter;
			<StopPLCAsync>d__.<>1__state = -1;
			<StopPLCAsync>d__.<>t__builder.Start<MelsecFxLinksOverTcp.<StopPLCAsync>d__23>(ref <StopPLCAsync>d__);
			return <StopPLCAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc cref="M:HslCommunication.Profinet.Melsec.MelsecFxLinksOverTcp.ReadPlcType(System.String)" />
		// Token: 0x0600089E RID: 2206 RVA: 0x0002EC10 File Offset: 0x0002CE10
		[DebuggerStepThrough]
		public Task<OperateResult<string>> ReadPlcTypeAsync(string parameter = "")
		{
			MelsecFxLinksOverTcp.<ReadPlcTypeAsync>d__24 <ReadPlcTypeAsync>d__ = new MelsecFxLinksOverTcp.<ReadPlcTypeAsync>d__24();
			<ReadPlcTypeAsync>d__.<>t__builder = AsyncTaskMethodBuilder<OperateResult<string>>.Create();
			<ReadPlcTypeAsync>d__.<>4__this = this;
			<ReadPlcTypeAsync>d__.parameter = parameter;
			<ReadPlcTypeAsync>d__.<>1__state = -1;
			<ReadPlcTypeAsync>d__.<>t__builder.Start<MelsecFxLinksOverTcp.<ReadPlcTypeAsync>d__24>(ref <ReadPlcTypeAsync>d__);
			return <ReadPlcTypeAsync>d__.<>t__builder.Task;
		}

		/// <inheritdoc />
		// Token: 0x0600089F RID: 2207 RVA: 0x0002EC5B File Offset: 0x0002CE5B
		public override string ToString()
		{
			return string.Format("MelsecFxLinksOverTcp[{0}:{1}]", this.IpAddress, this.Port);
		}

		/// <summary>
		/// 解析数据地址成不同的三菱地址类型
		/// </summary>
		/// <param name="address">数据地址</param>
		/// <returns>地址结果对象</returns>
		// Token: 0x060008A0 RID: 2208 RVA: 0x0002EC78 File Offset: 0x0002CE78
		private static OperateResult<string> FxAnalysisAddress(string address)
		{
			OperateResult<string> operateResult = new OperateResult<string>();
			try
			{
				char c = address[0];
				char c2 = c;
				if (c2 <= 'Y')
				{
					if (c2 <= 'D')
					{
						if (c2 == 'C')
						{
							goto IL_25E;
						}
						if (c2 != 'D')
						{
							goto IL_374;
						}
						goto IL_314;
					}
					else
					{
						if (c2 == 'M')
						{
							goto IL_142;
						}
						switch (c2)
						{
						case 'R':
							goto IL_344;
						case 'S':
							goto IL_175;
						case 'T':
							goto IL_1A8;
						case 'U':
						case 'V':
						case 'W':
							goto IL_374;
						case 'X':
							break;
						case 'Y':
							goto IL_100;
						default:
							goto IL_374;
						}
					}
				}
				else if (c2 <= 'd')
				{
					if (c2 == 'c')
					{
						goto IL_25E;
					}
					if (c2 != 'd')
					{
						goto IL_374;
					}
					goto IL_314;
				}
				else
				{
					if (c2 == 'm')
					{
						goto IL_142;
					}
					switch (c2)
					{
					case 'r':
						goto IL_344;
					case 's':
						goto IL_175;
					case 't':
						goto IL_1A8;
					case 'u':
					case 'v':
					case 'w':
						goto IL_374;
					case 'x':
						break;
					case 'y':
						goto IL_100;
					default:
						goto IL_374;
					}
				}
				ushort num = Convert.ToUInt16(address.Substring(1), 8);
				operateResult.Content = "X" + Convert.ToUInt16(address.Substring(1), 10).ToString("D4");
				goto IL_384;
				IL_100:
				ushort num2 = Convert.ToUInt16(address.Substring(1), 8);
				operateResult.Content = "Y" + Convert.ToUInt16(address.Substring(1), 10).ToString("D4");
				goto IL_384;
				IL_142:
				operateResult.Content = "M" + Convert.ToUInt16(address.Substring(1), 10).ToString("D4");
				goto IL_384;
				IL_175:
				operateResult.Content = "S" + Convert.ToUInt16(address.Substring(1), 10).ToString("D4");
				goto IL_384;
				IL_1A8:
				bool flag = address[1] == 'S' || address[1] == 's';
				if (flag)
				{
					operateResult.Content = "TS" + Convert.ToUInt16(address.Substring(1), 10).ToString("D3");
					goto IL_384;
				}
				bool flag2 = address[1] == 'N' || address[1] == 'n';
				if (flag2)
				{
					operateResult.Content = "TN" + Convert.ToUInt16(address.Substring(1), 10).ToString("D3");
					goto IL_384;
				}
				throw new Exception(StringResources.Language.NotSupportedDataType);
				IL_25E:
				bool flag3 = address[1] == 'S' || address[1] == 's';
				if (flag3)
				{
					operateResult.Content = "CS" + Convert.ToUInt16(address.Substring(1), 10).ToString("D3");
					goto IL_384;
				}
				bool flag4 = address[1] == 'N' || address[1] == 'n';
				if (flag4)
				{
					operateResult.Content = "CN" + Convert.ToUInt16(address.Substring(1), 10).ToString("D3");
					goto IL_384;
				}
				throw new Exception(StringResources.Language.NotSupportedDataType);
				IL_314:
				operateResult.Content = "D" + Convert.ToUInt16(address.Substring(1), 10).ToString("D4");
				goto IL_384;
				IL_344:
				operateResult.Content = "R" + Convert.ToUInt16(address.Substring(1), 10).ToString("D4");
				goto IL_384;
				IL_374:
				throw new Exception(StringResources.Language.NotSupportedDataType);
				IL_384:;
			}
			catch (Exception ex)
			{
				operateResult.Message = ex.Message;
				return operateResult;
			}
			operateResult.IsSuccess = true;
			return operateResult;
		}

		/// <summary>
		/// 计算指令的和校验码
		/// </summary>
		/// <param name="data">指令</param>
		/// <returns>校验之后的信息</returns>
		// Token: 0x060008A1 RID: 2209 RVA: 0x0002F050 File Offset: 0x0002D250
		public static string CalculateAcc(string data)
		{
			byte[] bytes = Encoding.ASCII.GetBytes(data);
			int num = 0;
			for (int i = 0; i < bytes.Length; i++)
			{
				num += (int)bytes[i];
			}
			return data + num.ToString("X4").Substring(2);
		}

		/// <summary>
		/// 创建一条读取的指令信息，需要指定一些参数
		/// </summary>
		/// <param name="station">PLCd的站号</param>
		/// <param name="address">地址信息</param>
		/// <param name="length">数据长度</param>
		/// <param name="isBool">是否位读取</param>
		/// <param name="sumCheck">是否和校验</param>
		/// <param name="waitTime">等待时间</param>
		/// <returns>是否成功的结果对象</returns>
		// Token: 0x060008A2 RID: 2210 RVA: 0x0002F0A4 File Offset: 0x0002D2A4
		public static OperateResult<byte[]> BuildReadCommand(byte station, string address, ushort length, bool isBool, bool sumCheck = true, byte waitTime = 0)
		{
			OperateResult<string> operateResult = MelsecFxLinksOverTcp.FxAnalysisAddress(address);
			bool flag = !operateResult.IsSuccess;
			OperateResult<byte[]> result;
			if (flag)
			{
				result = OperateResult.CreateFailedResult<byte[]>(operateResult);
			}
			else
			{
				StringBuilder stringBuilder = new StringBuilder();
				stringBuilder.Append(station.ToString("D2"));
				stringBuilder.Append("FF");
				if (isBool)
				{
					stringBuilder.Append("BR");
				}
				else
				{
					stringBuilder.Append("WR");
				}
				stringBuilder.Append(waitTime.ToString("X"));
				stringBuilder.Append(operateResult.Content);
				stringBuilder.Append(length.ToString("D2"));
				byte[] array;
				if (sumCheck)
				{
					array = Encoding.ASCII.GetBytes(MelsecFxLinksOverTcp.CalculateAcc(stringBuilder.ToString()));
				}
				else
				{
					array = Encoding.ASCII.GetBytes(stringBuilder.ToString());
				}
				array = SoftBasic.SpliceArray<byte>(new byte[][]
				{
					new byte[]
					{
						5
					},
					array
				});
				result = OperateResult.CreateSuccessResult<byte[]>(array);
			}
			return result;
		}

		/// <summary>
		/// 创建一条别入bool数据的指令信息，需要指定一些参数
		/// </summary>
		/// <param name="station">站号</param>
		/// <param name="address">地址</param>
		/// <param name="value">数组值</param>
		/// <param name="sumCheck">是否和校验</param>
		/// <param name="waitTime">等待时间</param>
		/// <returns>是否创建成功</returns>
		// Token: 0x060008A3 RID: 2211 RVA: 0x0002F1A8 File Offset: 0x0002D3A8
		public static OperateResult<byte[]> BuildWriteBoolCommand(byte station, string address, bool[] value, bool sumCheck = true, byte waitTime = 0)
		{
			OperateResult<string> operateResult = MelsecFxLinksOverTcp.FxAnalysisAddress(address);
			bool flag = !operateResult.IsSuccess;
			OperateResult<byte[]> result;
			if (flag)
			{
				result = OperateResult.CreateFailedResult<byte[]>(operateResult);
			}
			else
			{
				StringBuilder stringBuilder = new StringBuilder();
				stringBuilder.Append(station.ToString("D2"));
				stringBuilder.Append("FF");
				stringBuilder.Append("BW");
				stringBuilder.Append(waitTime.ToString("X"));
				stringBuilder.Append(operateResult.Content);
				stringBuilder.Append(value.Length.ToString("D2"));
				for (int i = 0; i < value.Length; i++)
				{
					stringBuilder.Append(value[i] ? "1" : "0");
				}
				byte[] array;
				if (sumCheck)
				{
					array = Encoding.ASCII.GetBytes(MelsecFxLinksOverTcp.CalculateAcc(stringBuilder.ToString()));
				}
				else
				{
					array = Encoding.ASCII.GetBytes(stringBuilder.ToString());
				}
				array = SoftBasic.SpliceArray<byte>(new byte[][]
				{
					new byte[]
					{
						5
					},
					array
				});
				result = OperateResult.CreateSuccessResult<byte[]>(array);
			}
			return result;
		}

		/// <summary>
		/// 创建一条别入byte数据的指令信息，需要指定一些参数，按照字单位
		/// </summary>
		/// <param name="station">站号</param>
		/// <param name="address">地址</param>
		/// <param name="value">数组值</param>
		/// <param name="sumCheck">是否和校验</param>
		/// <param name="waitTime">等待时间</param>
		/// <returns>命令报文的结果内容对象</returns>
		// Token: 0x060008A4 RID: 2212 RVA: 0x0002F2D0 File Offset: 0x0002D4D0
		public static OperateResult<byte[]> BuildWriteByteCommand(byte station, string address, byte[] value, bool sumCheck = true, byte waitTime = 0)
		{
			OperateResult<string> operateResult = MelsecFxLinksOverTcp.FxAnalysisAddress(address);
			bool flag = !operateResult.IsSuccess;
			OperateResult<byte[]> result;
			if (flag)
			{
				result = OperateResult.CreateFailedResult<byte[]>(operateResult);
			}
			else
			{
				StringBuilder stringBuilder = new StringBuilder();
				stringBuilder.Append(station.ToString("D2"));
				stringBuilder.Append("FF");
				stringBuilder.Append("WW");
				stringBuilder.Append(waitTime.ToString("X"));
				stringBuilder.Append(operateResult.Content);
				stringBuilder.Append((value.Length / 2).ToString("D2"));
				byte[] array = new byte[value.Length * 2];
				for (int i = 0; i < value.Length / 2; i++)
				{
					SoftBasic.BuildAsciiBytesFrom(BitConverter.ToUInt16(value, i * 2)).CopyTo(array, 4 * i);
				}
				stringBuilder.Append(Encoding.ASCII.GetString(array));
				byte[] array2;
				if (sumCheck)
				{
					array2 = Encoding.ASCII.GetBytes(MelsecFxLinksOverTcp.CalculateAcc(stringBuilder.ToString()));
				}
				else
				{
					array2 = Encoding.ASCII.GetBytes(stringBuilder.ToString());
				}
				array2 = SoftBasic.SpliceArray<byte>(new byte[][]
				{
					new byte[]
					{
						5
					},
					array2
				});
				result = OperateResult.CreateSuccessResult<byte[]>(array2);
			}
			return result;
		}

		/// <summary>
		/// 创建启动PLC的报文信息
		/// </summary>
		/// <param name="station">站号信息</param>
		/// <param name="sumCheck">是否和校验</param>
		/// <param name="waitTime">等待时间</param>
		/// <returns>命令报文的结果内容对象</returns>
		// Token: 0x060008A5 RID: 2213 RVA: 0x0002F41C File Offset: 0x0002D61C
		public static OperateResult<byte[]> BuildStart(byte station, bool sumCheck = true, byte waitTime = 0)
		{
			bool flag = !Authorization.asdniasnfaksndiqwhawfskhfaiw();
			OperateResult<byte[]> result;
			if (flag)
			{
				result = new OperateResult<byte[]>(StringResources.Language.InsufficientPrivileges);
			}
			else
			{
				StringBuilder stringBuilder = new StringBuilder();
				stringBuilder.Append(station.ToString("D2"));
				stringBuilder.Append("FF");
				stringBuilder.Append("RR");
				stringBuilder.Append(waitTime.ToString("X"));
				byte[] array;
				if (sumCheck)
				{
					array = Encoding.ASCII.GetBytes(MelsecFxLinksOverTcp.CalculateAcc(stringBuilder.ToString()));
				}
				else
				{
					array = Encoding.ASCII.GetBytes(stringBuilder.ToString());
				}
				array = SoftBasic.SpliceArray<byte>(new byte[][]
				{
					new byte[]
					{
						5
					},
					array
				});
				result = OperateResult.CreateSuccessResult<byte[]>(array);
			}
			return result;
		}

		/// <summary>
		/// 创建启动PLC的报文信息
		/// </summary>
		/// <param name="station">站号信息</param>
		/// <param name="sumCheck">是否和校验</param>
		/// <param name="waitTime">等待时间</param>
		/// <returns>命令报文的结果内容对象</returns>
		// Token: 0x060008A6 RID: 2214 RVA: 0x0002F4E8 File Offset: 0x0002D6E8
		public static OperateResult<byte[]> BuildStop(byte station, bool sumCheck = true, byte waitTime = 0)
		{
			bool flag = !Authorization.asdniasnfaksndiqwhawfskhfaiw();
			OperateResult<byte[]> result;
			if (flag)
			{
				result = new OperateResult<byte[]>(StringResources.Language.InsufficientPrivileges);
			}
			else
			{
				StringBuilder stringBuilder = new StringBuilder();
				stringBuilder.Append(station.ToString("D2"));
				stringBuilder.Append("FF");
				stringBuilder.Append("RS");
				stringBuilder.Append(waitTime.ToString("X"));
				byte[] array;
				if (sumCheck)
				{
					array = Encoding.ASCII.GetBytes(MelsecFxLinksOverTcp.CalculateAcc(stringBuilder.ToString()));
				}
				else
				{
					array = Encoding.ASCII.GetBytes(stringBuilder.ToString());
				}
				array = SoftBasic.SpliceArray<byte>(new byte[][]
				{
					new byte[]
					{
						5
					},
					array
				});
				result = OperateResult.CreateSuccessResult<byte[]>(array);
			}
			return result;
		}

		/// <summary>
		/// 创建读取PLC类型的命令报文
		/// </summary>
		/// <param name="station">站号信息</param>
		/// <param name="sumCheck">是否进行和校验</param>
		/// <param name="waitTime">等待实际</param>
		/// <returns>命令报文的结果内容对象</returns>
		// Token: 0x060008A7 RID: 2215 RVA: 0x0002F5B4 File Offset: 0x0002D7B4
		public static OperateResult<byte[]> BuildReadPlcType(byte station, bool sumCheck = true, byte waitTime = 0)
		{
			bool flag = !Authorization.asdniasnfaksndiqwhawfskhfaiw();
			OperateResult<byte[]> result;
			if (flag)
			{
				result = new OperateResult<byte[]>(StringResources.Language.InsufficientPrivileges);
			}
			else
			{
				StringBuilder stringBuilder = new StringBuilder();
				stringBuilder.Append(station.ToString("D2"));
				stringBuilder.Append("FF");
				stringBuilder.Append("PC");
				stringBuilder.Append(waitTime.ToString("X"));
				byte[] array;
				if (sumCheck)
				{
					array = Encoding.ASCII.GetBytes(MelsecFxLinksOverTcp.CalculateAcc(stringBuilder.ToString()));
				}
				else
				{
					array = Encoding.ASCII.GetBytes(stringBuilder.ToString());
				}
				array = SoftBasic.SpliceArray<byte>(new byte[][]
				{
					new byte[]
					{
						5
					},
					array
				});
				result = OperateResult.CreateSuccessResult<byte[]>(array);
			}
			return result;
		}

		/// <summary>
		/// 从编码中提取PLC的型号信息
		/// </summary>
		/// <param name="code">编码</param>
		/// <returns>PLC的型号信息</returns>
		// Token: 0x060008A8 RID: 2216 RVA: 0x0002F680 File Offset: 0x0002D880
		public static OperateResult<string> GetPlcTypeFromCode(string code)
		{
			uint num = <PrivateImplementationDetails>.ComputeStringHash(code);
			if (num <= 752165258U)
			{
				if (num <= 366132926U)
				{
					if (num <= 234789874U)
					{
						if (num != 134124160U)
						{
							if (num == 234789874U)
							{
								if (code == "92")
								{
									return OperateResult.CreateSuccessResult<string>("A2ACPU");
								}
							}
						}
						else if (code == "94")
						{
							return OperateResult.CreateSuccessResult<string>("A3ACPU");
						}
					}
					else if (num != 251567493U)
					{
						if (num != 335455588U)
						{
							if (num == 366132926U)
							{
								if (code == "F3")
								{
									return OperateResult.CreateSuccessResult<string>("FX3U/FX3UC");
								}
							}
						}
						else if (code == "98")
						{
							return OperateResult.CreateSuccessResult<string>("A0J2HCPU");
						}
					}
					else if (code == "93")
					{
						return OperateResult.CreateSuccessResult<string>("A2ACPU-S1");
					}
				}
				else if (num <= 486601254U)
				{
					if (num != 382910545U)
					{
						if (num != 416465783U)
						{
							if (num == 486601254U)
							{
								if (code == "8E")
								{
									return OperateResult.CreateSuccessResult<string>("FX0N");
								}
							}
						}
						else if (code == "F4")
						{
							return OperateResult.CreateSuccessResult<string>("FX3G");
						}
					}
					else if (code == "F2")
					{
						return OperateResult.CreateSuccessResult<string>("FX1S");
					}
				}
				else if (num != 503378873U)
				{
					if (num != 536934111U)
					{
						if (num == 752165258U)
						{
							if (code == "AB")
							{
								return OperateResult.CreateSuccessResult<string>("AJ72P25/R25");
							}
						}
					}
					else if (code == "8B")
					{
						return OperateResult.CreateSuccessResult<string>("AJ72LP25/BR15");
					}
				}
				else if (code == "8D")
				{
					return OperateResult.CreateSuccessResult<string>("FX2/FX2C");
				}
			}
			else if (num <= 2382472201U)
			{
				if (num <= 2029995107U)
				{
					if (num != 2013217488U)
					{
						if (num == 2029995107U)
						{
							if (code == "9E")
							{
								return OperateResult.CreateSuccessResult<string>("FX1N/FX1NC");
							}
						}
					}
					else if (code == "9D")
					{
						return OperateResult.CreateSuccessResult<string>("FX2N/FX2NC");
					}
				}
				else if (num != 2097105583U)
				{
					if (num != 2365694582U)
					{
						if (num == 2382472201U)
						{
							if (code == "84")
							{
								return OperateResult.CreateSuccessResult<string>("A3UCPU");
							}
						}
					}
					else if (code == "85")
					{
						return OperateResult.CreateSuccessResult<string>("A4UCPU");
					}
				}
				else if (code == "9A")
				{
					return OperateResult.CreateSuccessResult<string>("A2CCPU");
				}
			}
			else if (num <= 2530592872U)
			{
				if (num != 2399249820U)
				{
					if (num != 2416027439U)
					{
						if (num == 2530592872U)
						{
							if (code == "A4")
							{
								return OperateResult.CreateSuccessResult<string>("A3HCPU/A3MCPU");
							}
						}
					}
					else if (code == "82")
					{
						return OperateResult.CreateSuccessResult<string>("A2USCPU");
					}
				}
				else if (code == "83")
				{
					return OperateResult.CreateSuccessResult<string>("A2CPU-S1/A2USCPU-S1");
				}
			}
			else if (num != 2614480967U)
			{
				if (num != 2631258586U)
				{
					if (num == 2648036205U)
					{
						if (code == "A3")
						{
							return OperateResult.CreateSuccessResult<string>("A3CPU/A3NCPU");
						}
					}
				}
				else if (code == "A2")
				{
					return OperateResult.CreateSuccessResult<string>("A2CPU/A2NCPU/A2SCPU");
				}
			}
			else if (code == "A1")
			{
				return OperateResult.CreateSuccessResult<string>("A1CPU /A1NCPU");
			}
			return new OperateResult<string>(StringResources.Language.NotSupportedDataType + " Code:" + code);
		}

		// Token: 0x04000222 RID: 546
		private byte station = 0;

		// Token: 0x04000223 RID: 547
		private byte watiingTime = 0;

		// Token: 0x04000224 RID: 548
		private bool sumCheck = true;
	}
}
